const express = require('express');
const router = express.Router();
const messageController = require('../controllers/message');
const { verifyToken } = require('../middlewares/auth');
const upload = require('../middlewares/upload');

router.get('/', messageController.getMessages);
router.post('/', verifyToken, messageController.createMessage);
router.put('/:id', verifyToken, messageController.updateMessage);
router.put('/:id/image', verifyToken, upload.single('image'), messageController.updateMessageImage);
router.delete('/:id', verifyToken, messageController.deleteMessage);

module.exports = router;